﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;

namespace BanHangCshap
{
    /// <summary>
    /// Truyền thông báo Load dữ liệu
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void MyEvent_LoadData(object sender, ELoadData e);
    /// <summary>
    /// Thông tin thông báo Load dữ liệu
    /// </summary>
    public class ELoadData : EventArgs
    {
        public bool IsLoadData { get; set; }
    }

    /// <summary>
    /// Sự kiện đăng nhập
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void MyEvent_Login(object sender, infoLogin e);
    public class infoLogin: EventArgs
    {
        public Guid Id { get; set; }
        public string Ma { get; set; }
        public string Ten { get; set; }
        public Guid Id_Nhomnguoidung { get; set; }
    }

    public static class SDN
    {
        public static DateTime LayNgaydauthang()
        {
            string SDate = DateTime.Now.ToString("dd/MM/yyyy");
            string GetMonth = SDate.Substring(3, 2);
            return DateTime.ParseExact(String.Format("01/{0}/{1}", GetMonth, DateTime.Now.Year), "dd/MM/yyyy", null);
        }
    }
}



